import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
import store from '@/store'

export interface IAppState {
  direction: string
}

@Module({ dynamic: true, store, name: 'app' })
class App extends VuexModule implements IAppState {
  public direction: string = 'forward'

  @Mutation
  private SET_DIRECTION (direction: string) {
    this.direction = direction
  }

  @Action
  public SetDirection (direction: string) {
    this.SET_DIRECTION(direction)
  }
}

export const AppModule = getModule(App)
